/**
 * 
 */
package ligapiwna.model.services.impl.mock;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import ligapiwna.model.dto.BeerDTO;
import ligapiwna.model.dto.BeerKindDTO;
import ligapiwna.model.services.BeerService;

/**
 * @author Xan
 *
 */
public class BeerServiceMock implements BeerService {

	private static List<String> beerKinds;
	
	private static List<String> beers;
	
	static {
		
		beerKinds = new ArrayList<String>();
		beerKinds.add("Jasne");
		beerKinds.add("Ciemne");
		
		beers = new ArrayList<String>();
		
		beers.add("Perła chmielowa");
		beers.add("Zimny Lech");
		beers.add("Kasztelan");
		
	}
	

	@Override
	public void addBeerKind(String kindName) {
		beerKinds.add(kindName);

	}


	@Override
	public List<BeerKindDTO> listBeerKinds() {
		List<BeerKindDTO> ret = new ArrayList<BeerKindDTO>();
		
		for(String beerKind: beerKinds)
		{
			BeerKindDTO beerKindDTO = new BeerKindDTO();
			beerKindDTO.setName(beerKind);
			ret.add(beerKindDTO);
		}
		
		return ret;
	}


	@Override
	public void removeBeerKind(String kindName) {
		beerKinds.remove(kindName);
	}

	@Override
	public void addBeer(String beerName) {
		beers.add(beerName);
	}

	@Override
	public List<BeerDTO> listBeers() {
		List<BeerDTO> ret = new ArrayList<BeerDTO>();
		
		for(String beer: beers)
		{
			BeerDTO beerDTO = new BeerDTO();
			beerDTO.setName(beer);
			ret.add(beerDTO);
		}
		
		return ret;
	}

	@Override
	public void removeBeer(String beerName) {
		beers.remove(beerName);
	}

}
